package dobest.ray.com.jiongjiong.views;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;

import dobest.ray.com.jiongjiong.R;

/**
 * Created by Ray on 2016/3/11.
 * https://github.com/ray0807
 */
public class MumingleshiNoticeDialog implements View.OnClickListener {
    private Context c;
    private Dialog dialog;
    private Button btn_goto_test;


    public MumingleshiNoticeDialog(Context c) {
        this.c = c;
        init();
    }

    private void init() {
        dialog = new Dialog(c, R.style.CustomDialog);
        LayoutInflater inflater = LayoutInflater.from(c);
        final View v1 = inflater.inflate(R.layout.layout_mumingleshi_notice_dialog, null);
        dialog.setContentView(v1);// 设置使用View
        btn_goto_test = (Button) v1.findViewById(R.id.btn_goto_test);
        btn_goto_test.setOnClickListener(this);
    }

    public void show() {
        if (!dialog.isShowing())
            dialog.show();
    }

    public void dismiss() {
        if (dialog.isShowing())
            dialog.dismiss();
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_goto_test:
                dismiss();
                break;
        }
    }
}
